unit UModule_Entry_Jurnal_Penerimaan;

interface

uses
  soap_sis_entry_jurnal_penerimaan,
  Dialogs,
  Controls,
  SysUtils,
  Classes,
  InvokeRegistry,
  Rio,
  XSBuiltIns,
  SOAPHTTPClient,
  ActnList;

type
  TModule_Entry_Jurnal_Penerimaan = class(TDataModule)
    HTTPRIO1: THTTPRIO;
    ActionList1: TActionList;
    PFile_Simpan: TAction;
    PMenu_Entry_JurnalPenerimaan: TAction;
    procedure PFile_SimpanExecute(Sender: TObject);
    procedure PMenu_Entry_JurnalPenerimaanExecute(Sender: TObject);
    procedure HTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream);
  private
    procedure Assign_LoginInfo;
  public
    procedure Assign_Action;
  end;

var
  Module_Entry_Jurnal_Penerimaan: TModule_Entry_Jurnal_Penerimaan;

implementation

uses
  UMainApplication,
  UUser;
{$R *.dfm}

procedure TModule_Entry_Jurnal_Penerimaan.Assign_Action;
begin
try
  with Form_Main do
    begin
    TMB0105010601080201.Action := PFile_Simpan;
    with CB010501 do
      begin
      with Categories[6] do
        begin
        Items[3].Action := PMenu_Entry_JurnalPenerimaan;
        end;
      end;
    end;
except
  on E: Exception do
    begin
    ShowMessage(E.Message);
    end;
end;
end;

procedure TModule_Entry_Jurnal_Penerimaan.Assign_LoginInfo;
begin
try
  with Form_Main do
    begin
    GServer_Host     := IN010301.Text;
    GServer_Database := IN010302.Text;
    GServer_UserName := IN010303.Text;
    GServer_Password := IN010304.Text;
    GUserName        := LE01010101.Text;
    GUserPassword    := LE01010102.Text;
    end;
except
  on E: Exception do
    begin
    ShowMessage(E.Message);
    end;
end;
end;

procedure TModule_Entry_Jurnal_Penerimaan.HTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream);
var
  LocalStrings: TStringList;
begin
try
  LocalStrings          := TStringList.Create;
  SOAPResponse.Position := 0;
  LocalStrings.LoadFromStream(SOAPResponse);
  // ShowMessage(LocalStrings.Text);
  FreeAndNil(LocalStrings);
except
  on E: Exception do
    begin
    ShowMessage(E.Message);
    end;
end;
end;

procedure TModule_Entry_Jurnal_Penerimaan.PFile_SimpanExecute(Sender: TObject);
var
  InfoServer:                        TInfoServer;
  LocalDataJurnalPenerimaanInputRow: TDataJurnalPenerimaanInputRow;
  LocalDataJurnalPenerimaan:         TDataJurnalPenerimaanInput;
  InfoDate:                          TXSDateTime;
begin
try
  Assign_LoginInfo;
  InfoServer                        := TInfoServer.Create;
  LocalDataJurnalPenerimaanInputRow := TDataJurnalPenerimaanInputRow.Create;
  InfoDate                          := TXSDateTime.Create;
  InfoServer.Server_Host            := GServer_Host;
  InfoServer.Server_Database        := GServer_Database;
  InfoServer.Server_Username        := GServer_UserName;
  InfoServer.Server_Password        := GServer_Password;
  with Form_Main, HTTPRIO1 as SERVICE_ENTRY_SISWA_JURNALPENERIMAANPortType do
    begin
    LocalDataJurnalPenerimaanInputRow.USER_ID          := GUser_ID;
    LocalDataJurnalPenerimaanInputRow.PENERIMAAN_JENIS := IN01050106010801.Items[IN01050106010801.ItemIndex];
    InfoDate.AsDateTime                                := IN01050106010802.DateTime;
    LocalDataJurnalPenerimaanInputRow.PENERIMAAN_TGL   := InfoDate;
    LocalDataJurnalPenerimaanInputRow.PENERIMAAN_NILAI := StrToFloat(IN01050106010803.Text);
    LocalDataJurnalPenerimaanInputRow.PENERIMAAN_KETERANGAN := IN01050106010804.Text;
    SetLength(LocalDataJurnalPenerimaan, 1);
    LocalDataJurnalPenerimaan[0] := LocalDataJurnalPenerimaanInputRow;
    SISWA_SIMPAN_JURNALPENERIMAAN_DATASET(InfoServer, LocalDataJurnalPenerimaan);
    end;
except
  on E: Exception do
    begin
    ShowMessage(E.Message);
    end;
end;
end;

procedure TModule_Entry_Jurnal_Penerimaan.PMenu_Entry_JurnalPenerimaanExecute(Sender: TObject);
begin
try
  with Form_Main, TAB010501060108 do
    begin
    Show;
    end;
except
  on E: Exception do
    begin
    ShowMessage(E.Message);
    end;
end;
end;

end.
